import api from './api';
import { ServiceInfo, ApiResponse, PaginationParams, PaginationResult } from './types';

export const serviceInfoApi = {
  getServiceInfos: (params?: PaginationParams) => api.get<ApiResponse<PaginationResult<ServiceInfo>>>('/service_info', { params }) as unknown as Promise<ApiResponse<PaginationResult<ServiceInfo>>>,
  createServiceInfo: (data: Omit<ServiceInfo, 'id' | 'created_at'>) => api.post<ServiceInfo>('/service_info', data) as unknown as Promise<ApiResponse<ServiceInfo>>,
  updateServiceInfo: (id: number, data: Partial<ServiceInfo>) => api.put<ServiceInfo>(`/service_info/${id}`, data) as unknown as Promise<ApiResponse<ServiceInfo>>,
  deleteServiceInfo: (id: number) => api.delete<ApiResponse<ServiceInfo>>(`/service_info/${id}`) as unknown as Promise<ApiResponse<ServiceInfo>>,
}; 